//
//  NetworkingAESAndSHAConfigInterceptor.m
//  YiJuZhangShou2.0
//
//  Created by URANUS on 16/4/19.
//  Copyright © 2016年 Mr.X. All rights reserved.
//

#import "NetworkingAESAndSHAConfigInterceptor.h"

@implementation NetworkingAESAndSHAConfigInterceptor

- (BOOL)shouldCallAPIWithManager:(NetworkingBaseManager *)networkingManager{
    AFHTTPSessionManager *manager = networkingManager.manger;
    NSString *iv = ((NetworkingAESManager *)networkingManager).iv;
    if (manager != nil) {
        if (iv != nil) {
            [HeaderUtil generateSHA256Header:manager];
            [manager.requestSerializer setValue:iv forHTTPHeaderField:@"iv"];
            return YES;
        } else {
            DDLogError(@"Can Not Get iv, and iv Is nil");
        }
    } else {
        DDLogError(@"Can Not Get AFHTTPSessionManager");
    }
    return NO;
}

@end
